var objectChanges = mgr.query("from HibernateObjectChange");
log.info("Migrating object changes...");
for (var i = 0; i < objectChanges.size(); i++) {
  var change = objectChanges.get(i);

  var storyId = change.getItemId();
  var startDate = change.getOccurred();
  var stopDate = change.getStopDate();
  var owner = change.getValue("owner");
  //noinspection PointlessArithmeticExpressionJS
  var estimate = 0 + change.getValue("estimate");
  //noinspection PointlessArithmeticExpressionJS
  var effort = 0 + change.getValue("totalEffort");
  var size = Size.valueOf(change.getValue("size"));
  var severity = Severity.valueOf(change.getValue("severity"));
  var state = State.valueOf(change.getValue("state"));
  var queue = change.getValue("queue");
  var newChange = new StoryState(startDate, stopDate, storyId, owner, estimate, effort, state, severity, size, queue);
  updater.insert(newChange);
}
log.info("Done.  Migrated " + objectChanges.size() + " items.");